class Solution:
    def rangeBitwiseAnd(self, m: int, n: int) -> int:
        k = 0
        while m != n:
            m = m >> 1
            n = n >> 1
            k = k + 1
        return m << k


if __name__ == '__main__':
    so = Solution()
    m = 5
    n = 7
    r = so.rangeBitwiseAnd(m, n)
    print(r)
